Skip to content

fix(jobs): report the uptime heartbeat only after repeated failed pings - #219

Merged
ndbroadbent merged 2 commits into
mainfrom
nathan/uptime-heartbeat-repeated-failures
Nov 10, 2026
Merged

ndbroadbent merged 2 commits into
mainfrom
nathan/uptime-heartbeat-repeated-failures

Conversation

@ndbroadbent

Copy link
Copy Markdown
Member

A single failed uptime heartbeat ping (a slow answer from the monitoring service, a network blip) failed the heartbeat:uptime job, and the job error handler reported each one to Sentry. The heartbeat monitor already alerts when pings stop arriving, so those reports weren't actionable.

  • A failed ping is now logged as a warning. The job fails, and so reports, from the third failure in a row (uptime.FailuresBeforeReport), with the ping's error and how many pings in a row have failed. That covers a ping that keeps failing for a reason the monitor can't see (a wrong URL, a revoked key).
  • A successful ping resets the count. The count lives in the worker, which lasts as long as the process; a gateway runs one process.
  • The monitoring docs and internal/gateway/AGENTS.md say so.
  • Version bump to v0.1.36.

Testing

go test ./internal/gateway/jobs/uptime/ ./internal/gateway/jobs/: the two new tests (failures reported from the third in a row, and the count starting again after a successful ping) fail on main's worker. golangci-lint run ./internal/gateway/jobs/...: 0 issues.

@deepsource-io

deepsource-io Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 6186592...bf39c5c on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Nov 10, 2026 11:30p.m. Review ↗
Go Nov 10, 2026 11:30p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

A single failed ping (a slow response from the monitoring service, a network
blip) failed the job, and the job error handler reported each one to Sentry.
The heartbeat monitor already alerts when pings stop arriving, so those
reports weren't actionable. A failed ping is now logged, and the job fails,
with how many pings in a row have failed, from the third failure in a row.
@ndbroadbent
ndbroadbent force-pushed the nathan/uptime-heartbeat-repeated-failures branch from 38783e4 to bf39c5c Compare November 10, 2026 23:30
@ndbroadbent
ndbroadbent merged commit 2b0eba4 into main Nov 10, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant